package info.techgeek.labs.excel;

import java.awt.Image;
import java.io.File;
import java.io.IOException;
import java.util.Locale;
/*
class readXls 
{
  public static void main(String[] args) 
  {
    try
    {
      String filename = "input.xls";
      WorkbookSettings ws = new WorkbookSettings();
      ws.setLocale(new Locale("en", "EN"));

      Workbook workbook = Workbook.getWorkbook(
        new File(filename),ws);

      Sheet s  = workbook.getSheet(0);
      Sheet s1  = workbook.getSheet(1);
      readDataSheet(s1);
      readImageSheet(s);
      workbook.close();      
    }
    catch (IOException e)
    {
      e.printStackTrace();
    }
    catch (BiffException e)
    {
      e.printStackTrace();
    }
    
  }

  private static void readDataSheet(Sheet s)
  {
    // Find the labeled cell from sheet
    LabelCell lc = s.findLabelCell("Date");
    System.out.println(lc.getString());

    //gets the value of cell at specified column and row
    DateCell dc =(DateCell) s.getCell(0,1);
    System.out.println(dc.getDate());

    lc = s.findLabelCell("Add 2 cells");
    System.out.println(lc.getString());

    NumberCell c =(NumberCell) s.getCell(4,1);
    System.out.println(c.getValue());

    c =(NumberCell) s.getCell(4,2);
    System.out.println(c.getValue());

    NumberFormulaCell nc =(NumberFormulaCell) s.getCell(4,3);
    System.out.println(nc.getValue());

  }

  private static void readImageSheet(Sheet s)
  {
    LabelCell lc = s.findLabelCell("Image");
    System.out.println(lc.getString());

    // Gets the image stored in excel document
    Image c = s.getDrawing(0);
    System.out.println(c.getImageFile());

  }
}*/